module ObservableTest

open System
open System.Reactive.Linq

open Xunit
open Xunit.FSharp

open Trading.Observable

[<Fact>]
let bind() =
    let expected = 5
    observable { 
        let! actual = Observable.Return(expected)
        actual |> should equal expected
    } 
    |> ObservableExtensions.Subscribe
    |> ignore

[<Fact>]
let Yield() =
    let expected = 5
    observable { yield expected }
    |> Observable.First
    |> should equal expected

[<Fact>]
let Then() =
    let expected = 5
    Observable.Return None >> Observable.Return expected
    |> Observable.First 
    |> should equal expected

    